﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SelfHosting;
using System.Web.Http.SelfHost;
using System.Net.Http;
using System.Net.Http.Headers;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                var address = "http://localhost:8090";
                Console.Write(String.Format("Démarrage du serveur {0} ...", address));
                using (var server = new HttpSelfHostServer(new MySelfHostConfiguration(address)))
                {
                    server.OpenAsync().Wait();
                    Console.WriteLine("OK");
                    Console.WriteLine("Press Enter to quit.");
                    Console.ReadLine();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine();
                Console.WriteLine(ex.Message);
                Console.ReadLine();
            }
        }
    }

}
